/**
 * 
 */
package hawk.example;

import org.junit.jupiter.params.converter.ArgumentConversionException;
import org.junit.jupiter.params.converter.TypedArgumentConverter;

/**
 * @author Hawk
 *
 */
public class ToLengthArgumentConverter extends TypedArgumentConverter<String, Integer> {

	/**
	 * @param sourceType
	 * @param targetType
	 */
	protected ToLengthArgumentConverter() {
		super(String.class, Integer.class);
	}

	@Override
	protected Integer convert(String source) throws ArgumentConversionException {
		return (source != null ? source.length() : 0);
	}

}
